import request from '@/config/axios'
import type { Dayjs } from 'dayjs';

/** 联盟成员链接信息 */
export interface AllianceMembers {
          id: number; // 公司id
          corporateName: string; // 公司名称
          sort?: number; // 显示顺序
          visitors?: number; // 浏览人数
          status?: number; // 显示状态（0正常 1停用）
          imagePath?: string; // 图片地址
  }

// 联盟成员链接 API
export const AllianceMembersApi = {
  // 查询联盟成员链接分页
  getAllianceMembersPage: async (params: any) => {
    return await request.get({ url: `/biz/alliance-members/page`, params })
  },

  // 查询联盟成员链接详情
  getAllianceMembers: async (id: number) => {
    return await request.get({ url: `/biz/alliance-members/get?id=` + id })
  },

  // 新增联盟成员链接
  createAllianceMembers: async (data: AllianceMembers) => {
    return await request.post({ url: `/biz/alliance-members/create`, data })
  },

  // 修改联盟成员链接
  updateAllianceMembers: async (data: AllianceMembers) => {
    return await request.put({ url: `/biz/alliance-members/update`, data })
  },

  // 删除联盟成员链接
  deleteAllianceMembers: async (id: number) => {
    return await request.delete({ url: `/biz/alliance-members/delete?id=` + id })
  },

  /** 批量删除联盟成员链接 */
  deleteAllianceMembersList: async (ids: number[]) => {
    return await request.delete({ url: `/biz/alliance-members/delete-list?ids=${ids.join(',')}` })
  },

  // 导出联盟成员链接 Excel
  exportAllianceMembers: async (params) => {
    return await request.download({ url: `/biz/alliance-members/export-excel`, params })
  },
}